<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>商品表</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
</head>
<body>
	<div class="page-header" >
	  <h1>欢迎浏览商店 <small></small></h1>
	</div>
<table class="table table-hover">
		<thead >
			<th>商品ID</th>
			<th>商品编号</th>
			<th>商品名称</th>
			<th>商品价格</th>
			<th>商品库存</th>
			<th>商品生产商</th>
			<th>商品生产日期</th>
			<th>商品图片</th>
			<th>商品描述</th>
			<th>商品生产地</th>
			<th>类别ID</th>
			<th>修改</th>
			<th>删除</th>
		</thead>
		<c:forEach items= "${products.pros }" var="pro">
			<tr>
				<td>${pro.proID }</td>
				<td>${pro.proNum }</td>
				<td>${pro.proName }</td>
				<td>${pro.proPrice }</td>
				<td>${pro.proCount }</td>
				<td>${pro.proMannufacturer }</td>
				<td>${pro.proDate }</td>
				<td><img src="http://localhost:8080/test/${pro.proImg }" width="68px" height="55px"></td>
				<td>${pro.proDes}</td>
				<td>${pro.proPlace }</td>
				<td>${pro.cId }</td>
				<td><a href="UpdateServ?proID=${pro.proID }">修改</a></td>
				<td><a href="DelServ?proID=${pro.proID }">删除</a></td>
			</tr>
		</c:forEach>
	</table>
	<nav aria-label="...">
	  <ul class="pagination">
	  	<c:if test="${products.pageNum!=1}">
	  		<li class="active"><a href="${pageContext.request.contextPath }/ShowProListServ2?pageNum=${products.pageNum-1} " aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
	  	</c:if>
	  	<c:forEach begin="${products.startPage }" end="${products.endPage }" step="1" var="i">
			
			<li class="active"><a href="${pageContext.request.contextPath }/ShowProListServ2?pageNum=${i}">${i} <span class="sr-only">(current)</span></a></li>
		
		</c:forEach>
			<c:if test="${products.pageNum<products.allPages}">
	  		<li class="active"><a href="${pageContext.request.contextPath }/ShowProListServ2?pageNum=${products.pageNum+1}" aria-label="Next"><span aria-hidden="true">&raquo;</span></a></li>
	  	</c:if>
	  </ul>
</nav>
<a class="btn btn-default" href="addOnePro" role="button">添加商品</a>
</body>
</html>